package com.itlong.cloud.user.app;

import com.itlong.cloud.POJO.VO.app.engineer.AppEngineerUserInfoVO;
import com.itlong.cloud.POJO.VO.app.engineer.AppEngineerUserOwnProjectVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <desc>
 *      工程版APP接口暴露。
 * <desc/>
 *
 * @createDate 2017/11/6.
 */
@FeignClient(name="user-service")
public interface IAppEngineerServiceClient {

    /**
     * <desc>
     *     记录APP端用户登录信息
     * </desc>
     * @param userInfoPO
     * @return
     * @author shengen.T
     * @throws Exception
     * @createDate 2017/11/6
     */
    @RequestMapping(path = "/engineer/logEngineerLogin",method = RequestMethod.POST)
    AppEngineerUserInfoVO logEngineerLoginInfo(@RequestBody AppEngineerUserInfoVO userInfoPO) throws  Exception;


    /**
     * <desc>
     *      获取工程版APP登录信息。
     * <desc/>
     *
     * @param  phoneNo 工程人员账号
     * @return
     * @author shengen.T
     * @createDate 2018-01-20
     */
    @RequestMapping(path = "/engineer/getUserInfoByPhoneNo",method = RequestMethod.POST)
    AppEngineerUserInfoVO getEngineerAppUserLogin(@RequestParam("phoneNo") String phoneNo) throws Exception;


    /**
     * <desc>
     *      验证工程账号权限信息。
     * <desc/>
     *
     * @param  userId 用户ID
     * @return
     * @author shengen.T
     * @createDate 2018-01-20
     */
    @RequestMapping(path = "/engineer/checkEngineerAuth",method = RequestMethod.POST)
    Integer checkEngineerLogin(@RequestParam("userId") String userId) throws Exception;


    /**
     * <desc>
     *     APP端登录获取用户项目列表信息
     * </desc>
     *
     * @param userId  用户ID
     * @return  APP用户所拥有的项目配置信息的集合
     * @author shengen.T
     * @createDate 2017/11/6
     */
    @RequestMapping(path = "/engineer/getUserOwnProjectsInfo",method = RequestMethod.POST)
    List<AppEngineerUserOwnProjectVO> getUserOwnProjectsInfo(@RequestParam("userId") String userId) throws  Exception;

    /**
     * <desc>
     *      从缓存获取用户信息
     * </desc>
     *
     * @param token
     * @return
     * @author shengen.T
     * @createDate 2017/11/8
     */
    @RequestMapping(path = "/engineer/retrieve")
    AppEngineerUserInfoVO retrieve(@RequestParam("token")String token)  throws  Exception;



    /**
     * <desc>
     *     工程版APP,更新密码
     * </desc>
     * @param userId
     * @param oldPswd 加密后的旧密码
     * @param currentPswd 加密后的新密码
     * @return
     * @author shengen.T
     * @createDate 2017/10/11
     */
    @RequestMapping(path = "/engineer/updatePswd",method = RequestMethod.POST)
    Integer updatePswd(@RequestParam("userId") String userId,@RequestParam("oldPswd") String oldPswd,@RequestParam("currentPswd") String currentPswd) throws Exception;

}
